/*
 * Created on Apr 27, 2005
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package com.novix.portal.framework.util;

import java.io.Serializable;

import javax.servlet.http.HttpSessionBindingEvent;
import javax.servlet.http.HttpSessionBindingListener;

import org.apache.log4j.Logger;

import com.novix.portal.framework.model.IPortalUser;

/**
 * @author Dev
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class UserContainer implements HttpSessionBindingListener, Serializable {
    /**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	/**
     * Logger for this class
     */
    private static final Logger logger = Logger.getLogger(UserContainer.class);

    private String iextenstionsPath;

    private String legacyDominoAppPath;

    private String token;

    /**
     * The container calls this method when it is being unbound from the
     * session.
     */
    public void valueUnbound(HttpSessionBindingEvent event) {
        // Perform resource cleanup
        if (logger.isDebugEnabled()) {
            logger.debug("valueUnbound(HttpSessionBindingEvent) - Being unbound...");
        }
        cleanUp();
    }

    /**
     * The container calls this method when it is being bound to the session.
     */
    public void valueBound(HttpSessionBindingEvent event) {
        // Don't need to do anything, but still have to implement the
        // interface method.
    }

    /**
     * Initialize all of the required resources
     */
    private void initialize() {
    }

    /**
     * Clean up any open resources.
     */
    public void cleanUp() {

    }

    /**
     * @return Returns the iextenstionsPath.
     */
    public String getIextenstionsPath() {
        return iextenstionsPath;
    }

    /**
     * @param iextenstionsPath
     *            The iextenstionsPath to set.
     */
    public void setIextenstionsPath(String iextenstionsPath) {
        this.iextenstionsPath = iextenstionsPath;
    }

    /**
     * @return Returns the legacyDominoAppPath.
     */
    public String getLegacyDominoAppPath() {
        return legacyDominoAppPath;
    }

    /**
     * @param legacyDominoAppPath
     *            The legacyDominoAppPath to set.
     */
    public void setLegacyDominoAppPath(String legacyDominoAppPath) {
        this.legacyDominoAppPath = legacyDominoAppPath;
    }

    /**
     * @return Returns the token.
     */
    public String getToken() {
        return token;
    }

    /**
     * @param token
     *            The token to set.
     */
    public void setToken(String token) {
        this.token = token;
    }

    private String captiveName;

    private IPortalUser user;

    /**
     * @return Returns the captiveName.
     */
    public String getCaptiveName() {
        return captiveName;
    }

    /**
     * @param captiveName
     *            The captiveName to set.
     */
    public void setCaptiveName(String captiveName) {
        this.captiveName = captiveName;
    }

    /**
     * @return Returns the user.
     */
    public IPortalUser getUser() {
        return user;
    }

    /**
     * @param user
     *            The user to set.
     */
    public void setUser(IPortalUser user) {
        this.user = user;
    }
}
